﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;
using WmWebSystem.Models;
using WmWebSystem.Service;
using WmWebSystem.DbHelper;

namespace WmWebSystem.Controllers
{
    public class CommentController : Controller
    {
        //
        // GET: /Comment/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Create() 
        {
            string Id = Request.Form["ProjectId"];
            string pno = Request.Form["ProjectNo"];
            string message = Request.Form["CommentMsg"].Trim();
            CommentHelper.AddNew(pno, message);
            return RedirectToAction("Details", "Project", new { id = Id });
        }

        public ActionResult CreateInZone()
        {
            string pno = Request.Form["ProjectNo"];
            string message = Request.Form["CommentMsg"].Trim();
            CommentHelper.AddNew(pno, message);
            return RedirectToAction("Index", "Zone");
        }


    }
}
